#ifndef __BUS_MSG_H
#define __BUS_MSG_H

#include <stdio.h>
#include <malloc.h>
#include <string.h>
#include <unistd.h>
#include <time.h>

typedef struct
{
	FILE *f;
} z_log;

z_log z_log_init(char *p);
z_log z_log_init_with_file(FILE *f);
int z_log_release(z_log l);
FILE *z_log_file_get(z_log *l);

typedef struct tm *z_time;

z_time z_now();
char *z_timestr(z_time t);

typedef struct
{
	z_time time;
	int code;
	char *msg;
} z_msg;

z_msg z_msg_init(int c, char *m);
int z_msg_release(z_msg m);
int z_msg_dump(z_log *l, z_msg *m);
int z_msg_eval(z_msg *m);

#endif
